#include "SDLGameObject.h"
#include "GameHandler.h"


SDLGameObject::SDLGameObject(const Loader* pParams)
	: GameObject(pParams), m_position((float)pParams -> m_x, (float)pParams -> m_y)
{
	m_width  = pParams -> m_width; 
	m_height = pParams -> m_height; 

	m_textureID = pParams -> m_textureID; 

	m_currentRow   = 1; 
	m_currentFrame = 1; 
}


void SDLGameObject::Render() const 
{
	TextureManager::Instance() -> drawFrame
	(
	    m_textureID, 
	    static_cast <int> (m_position.x), 
		static_cast <int> (m_position.y), 
		m_width, 
		m_height, 
		m_currentRow, 
		m_currentFrame, 
		GameHandler::Instance() -> getRenderer()
	); 
	
}


void SDLGameObject::Update()
{
	m_velocity += m_acceleration; 
	m_position += m_velocity; 
}


void SDLGameObject::CleanUp()
{
}